package com.xiaohudie;

import com.xiaohudie.config.Myconfig;
import com.xiaohudie.pojo.Car;
import com.xiaohudie.pojo.People;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.web.bind.annotation.ControllerAdvice;

/**
 * @Author xiao hu die
 * @Date 2022/2/22 20:48
 * @Version 1.0
 */
/**这是一个springboot工程
 * 主程序类*/
/**配置包扫描*/
@SpringBootApplication(scanBasePackages = "com.xiaohudie")
/**注解扫描*/
@EnableAspectJAutoProxy
/**开启全局异常处理*/
//@ControllerAdvice
public class XiaohudieApplication {
    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(XiaohudieApplication.class, args);
       /* String[] beanDefinitionNames = run.getBeanDefinitionNames();
        for (String beanDefinitionName : beanDefinitionNames) {
            System.out.println(beanDefinitionName);
        }
        Myconfig bean = run.getBean(Myconfig.class);
        People people = bean.people();
        People people1 = bean.people();
        System.out.println(people==people1);*/
        //  People bean1 = run.getBean(People.class);
      /*  String[] beanNamesForType = run.getBeanNamesForType(People.class);
        for (String s : beanNamesForType) {
            System.err.println(s);
        }

        int beanDefinitionCount = run.getBeanDefinitionCount();
        System.err.println(beanDefinitionCount);
    }*/

    }
}
